package com.crr.controller;

import com.crr.ret.ResultData;
import com.crr.service.StorageService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class StorageController {
    @Resource
    private StorageService storageService;
    @PostMapping("/storage/decrease")
    public ResultData decrease(Long productId,Integer count){
        storageService.decrease(productId,count);
        return ResultData.success("扣减库存成功");
    }
}
